package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the WH_TYPE database table.
 * 
 */
@Entity
@Table(name="WH_TYPE")
@NamedQuery(name="WhType.findAll", query="SELECT w FROM WhType w")
public class WhType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="WTYPE_ID")
	private long wtypeId;

	@Column(name="WTYPE_NAME")
	private String wtypeName;

	//bi-directional many-to-one association to Warehouse
	@OneToMany(mappedBy="whType")
	private List<Warehouse> warehouses;

	public WhType() {
	}

	public long getWtypeId() {
		return this.wtypeId;
	}

	public void setWtypeId(long wtypeId) {
		this.wtypeId = wtypeId;
	}

	public String getWtypeName() {
		return this.wtypeName;
	}

	public void setWtypeName(String wtypeName) {
		this.wtypeName = wtypeName;
	}

	public List<Warehouse> getWarehouses() {
		return this.warehouses;
	}

	public void setWarehouses(List<Warehouse> warehouses) {
		this.warehouses = warehouses;
	}

	public Warehouse addWarehous(Warehouse warehous) {
		getWarehouses().add(warehous);
		warehous.setWhType(this);

		return warehous;
	}

	public Warehouse removeWarehous(Warehouse warehous) {
		getWarehouses().remove(warehous);
		warehous.setWhType(null);

		return warehous;
	}

}